package com.example.xcsubsystem.repository;

import com.example.xcsubsystem.entity.UserResourceEntity;
import com.example.xcsubsystem.vo.UserServiceVO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * 2024/9/28
 *
 * @author fengyu
 */
public interface UserResourceRepository extends JpaRepository<UserResourceEntity, Long> {
    @Query("select new com.example.xcsubsystem.vo.UserServiceVO(us.remoteId, us.status) from UserResourceEntity us where us.accountId=?1")
    List<UserServiceVO> findAllByAccountIdMatches(String accountId);
}
